<?
layout("/inc/layout.html",{title:sysTitle}){
?>

<div id="page-wrapper">
	<!--BEGIN TITLE & BREADCRUMB PAGE-->
	<div id="title-breadcrumb-option-demo" class="page-title-breadcrumb">
		<div class="page-header pull-left">
			<div class="page-title">意见反馈管理</div>
		</div>
		<ol class="breadcrumb page-breadcrumb pull-left">
			<li><i class="fa fa-home"></i>&nbsp;<a href="main.html">首页</a>&nbsp;&nbsp;<i
				class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li>系统管理&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
			<li class="active">意见反馈管理</li>
		</ol>

		<div class="clearfix"></div>
	</div>
	<!--END TITLE & BREADCRUMB PAGE-->
	<!--BEGIN CONTENT-->
	<div class="page-content">


		<div class="row mbl" >
			<div class="col-lg-6">
				<div class="input-group input-group-sm mbs">
					<span class="input-group-btn">
						<select id="queryParams" data-toggle="dropdown" class="btn btn-danger dropdown-toggle" style="width :100px;">
		                    <option value="-1">筛选项&nbsp;<span class="caret"></span></option>
		                    <option value="title">标题</option>
		                    <option value="problem">问题</option>
		                    <option value="name">姓名</option>
                    	</select>
                   </span> 
                    	<input id="text" type="text" placeholder="请输入关键词..." class="form-control" /><span
						class="input-group-btn"><button type="button"
							data-toggle="dropdown" class="btn btn-success dropdown-toggle" onclick="get()">搜索</button>
					</span>
				</div>
			</div>
			<div class="col-lg-6">
				<div class="tb-group-actions pull-right">
					<!-- <span >当前已选择<span id="Xuannum">0</span>条记录:</span> 
					<button class="btn btn-sm btn-primary" onclick="delePiLiang()">
						<i class="fa fa-check"></i>&nbsp; 删除多项
					</button>   -->
<!-- 					<button class="btn btn-sm btn-primary" onclick="addUpdateUser('0')">新增
					</button> -->
				</div>
			</div>
		</div>

		<table
			class="table table-hover table-striped table-bordered table-advanced tablesorter mbn">
			<thead>
				<tr>
					<th style="width:50px;" >序号</th>
					<th style="width:180px;">标题</th>
					<th >问题</th>
					<th >姓名</th>
					<th >邮箱</th>
					<th >电话</th>
					<th style="width:150px;">反馈日期</th>
					<th >图片</th>
					<!-- <th >个性签名</th> -->
					<th style="width:60px;">可操作</th>
				</tr>
			</thead>
			<tbody id="findFeedback">
			</tbody>
		</table>
		<div id="dataNull" class="panel-body"
				style="height: 90px; line-height: 50px;" align="center">
		</div>
		<div id="page2" style="text-align: center; margin-top: 20px;"></div>
		<div id="phs" style="display: none;text-align:center;margin:0 auto;">
		
	</div>

	<!--END CONTENT-->
</div>


<?} ?>
<script>
	var curr;
	var id;
	$(function() {
		
		demo1(1);
	});
	function get() {
		demo1(curr);
	}
	function getlay() {
		return id;
	}

	function del(id) {
		if (confirm("是否确认删除！！"))
		{
			$.ajax({
				type : "post",
				url : "./feedbackDeleteMent.do",
				data : {
					"id" : id
				},
				dataType : "json",
				success : function(data) {
					demo1();
					layer.msg('删除成功');
				},
				error : function(data) {
					alert("请求失败");
				}
			});
		}
	}
	
	//编辑放大
	function querypho(phoPhath){
		var singph = phoPhath;
		if(singph != null && singph != '' && singph != undefined){
			$('#phs').html("<img src=\""+singph+"\" style='height: auto;max-height: 500px;' />");
		}
		var index=layer.open({
		  type: 1,
		  title: false,
		  closeBtn: 1,
		  area: ['auto','auto'],
		  skin: 'layui-layer-nobg', //没有背景色
		  shadeClose: true,
		  content: $('#phs')
		});
		layer.iframeAuto(index);
	}
	function demo1(curr) {
		$.getJSON("./feedbackQueryMent.do",
			{
				page : curr || 1,
				queryParams:$("#queryParams").val(),
        		text:$("#text").val(),
			},
			function(res) {
				//此处仅仅是为了演示变化的内容
				var str = "";
				$("#findFeedback").html("");
				if(res[0].result.length>0){
					$("#dataNull").html("");
				}else{
					$("#dataNull").html("<span class='subtitle' style='font-size: 15px;'>数据为空!</span>");
				}
				for ( var i = 0; i < res[0].result.length; i++) {
					var qs="<a href='javascript:querypho(\""+res[0].result[i].picture+"\")' >";
					var qt = qs+ '<img src='+res[0].result[i].picture+' width="30" height="30"/></a>';	
					if(res[0].result[i].picture==null||res[0].result[i].picture==""){
						qt="";
						}
					str += "<tr><td>"
							+ (i + 1)
							+ "</td><td> <label id=>"
							+ res[0].result[i].title
							+ "</label></td><td><label >"
							+ res[0].result[i].problem
							+ "</label></td><td><label >"
							+ res[0].result[i].name
							+ "</label></td><td><label >"
							+ res[0].result[i].email
							+ "</label></td><td><label >"
							+ res[0].result[i].phone
							+ "</label></td><td><label >"
							+ res[0].result[i].createTime
							+ "</label></td><td><label >"
							+ qt
							+ "</label></td><td>"
							+ "<button type=\"button\" class=\"btn btn-default btn-xs\"onclick=\"del('"
							+ res[0].result[i].id
							+ "')\">"
							+ "删除"
							+ "</button>" + "</td></tr>";
				}
				$("#findFeedback").append(str);

				laypage({
					cont : document.getElementById('page2'), //容器。值支持id名、原生dom对象，jquery对象,
					pages : res[0].pageSize, //总页数
					skip : true, //是否开启跳页
					skin : 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
					curr: curr || 1,
					last: res[0].pageSize,
					groups : 6,//连续显示分页数
					jump : function(obj, first) { //触发分页后的回调
						if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
							demo1(obj.curr);
							 var curr = obj.curr;
			                 curr=obj.curr;
						}
					}
				});
			});
	};

	
</script>